Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alessandro/address bookmarks feedback folder logic #2221

Conversation

alessandroboron
Copy link
Contributor

Task/Issue URL: https://app.asana.com/0/72649045549333/1206590790808721/f
CC: @samsymons

Description:

  1. Added logic and test for AddEditBookmarkFolderViewModel.
  2. I’ve made a common view to re-use by AddBookmarkPopoverView & AddEditBookmarkDialogView
  3. Enhance BookmarkManager & BookmarkStore to update Folder title and location in one save.

NOTE

Number 3 Involves some refactor in the BookmarkStore. Unit tests still pass and I’ve also added relevant ones. If it’s considered too high risk of a change I can discard last commit.

Steps to test this PR:

<!—
Tagging instructions
If this PR isn't ready to be merged for whatever reason it should be marked with the DO NOT MERGE label (particularly if it's a draft)
If it's pending Product Review/PFR, please add the Pending Product Review label.

If at any point it isn't actively being worked on/ready for review/otherwise moving forward (besides the above PR/PFR exception) strongly consider closing it (or not opening it in the first place). If you decide not to close it, make sure it's labelled to make it clear the PRs state and comment with more information.
—>

Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

Copy link
Contributor

🚫 The Asana task linked in the PR description is not added to macOS App Board project.

  1. Verify that the correct task is linked in the PR.
    • ⚠️ Please use the actual implementation task, rather than the Code Review subtask.
  2. Verify that the task is added to macOS App Board project.
  3. When ready, remove the bot: not in app board label to retrigger the check.

@github-actions github-actions bot added the bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project label Feb 19, 2024
Copy link
Contributor

github-actions bot commented Feb 19, 2024

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS against afeebfb

private extension LocalBookmarkStore {

@discardableResult
func update(folder: BookmarkFolder, in context: NSManagedObjectContext) throws -> BookmarkEntity {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic was already existing, I just moved into its own function so that I can use either when the folder is updated (title changes) and when the folder moves within another parent folder

}

func move(entities: [BookmarkEntity], toIndex index: Int?, withinParentFolderType type: ParentFolderType, in context: NSManagedObjectContext) throws {
guard let rootFolder = bookmarksRoot(in: context) else {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, I just moved this existing logic in its own function so I can use it when doing an update and move in one go.

Copy link
Collaborator

@SabrinaTardio SabrinaTardio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Job! 👏

@@ -468,6 +468,45 @@ final class LocalBookmarkStoreTests: XCTestCase {
XCTAssertEqual(topLevelEntityIDs, [testState.initialParentFolder.id, testState.bookmark3.id])
}

func testWhenUpdatingAndMovingBookmarkFolder_ThenBookmarkFolderIsMovedAndTitleUpdated() async throws {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth testing also just moving the folder and just changing the title?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve checked and the tests weren’t there so I’ve added them (commit afeebfb)

@alessandroboron alessandroboron merged commit f00d684 into alessandro/address-bookmarks-feedback Feb 23, 2024
16 of 17 checks passed
@alessandroboron alessandroboron deleted the alessandro/address-bookmarks-feedback-folder-logic branch February 23, 2024 01:00
alessandroboron added a commit that referenced this pull request Feb 27, 2024
Task/Issue URL:
https://app.asana.com/0/72649045549333/1206590790808721/f

**Description**:
1. Add logic and test for `AddEditBookmarkFolderViewModel`.
2. Make a common view to re-use by `AddBookmarkPopoverView` &
`AddEditBookmarkDialogView`
3. Enhance `BookmarkManager` & `BookmarkStore` to update Folder title
and location in one save.
alessandroboron added a commit that referenced this pull request Mar 7, 2024
Task/Issue URL:
https://app.asana.com/0/72649045549333/1206590790808721/f

**Description**:
1. Add logic and test for `AddEditBookmarkFolderViewModel`.
2. Make a common view to re-use by `AddBookmarkPopoverView` &
`AddEditBookmarkDialogView`
3. Enhance `BookmarkManager` & `BookmarkStore` to update Folder title
and location in one save.
alessandroboron added a commit that referenced this pull request Mar 7, 2024
Task/Issue URL:
https://app.asana.com/0/72649045549333/1206590790808721/f

**Description**:
1. Add logic and test for `AddEditBookmarkFolderViewModel`.
2. Make a common view to re-use by `AddBookmarkPopoverView` &
`AddEditBookmarkDialogView`
3. Enhance `BookmarkManager` & `BookmarkStore` to update Folder title
and location in one save.
alessandroboron added a commit that referenced this pull request Mar 7, 2024
Task/Issue URL:
https://app.asana.com/0/72649045549333/1206590790808721/f

**Description**:
1. Add logic and test for `AddEditBookmarkFolderViewModel`.
2. Make a common view to re-use by `AddBookmarkPopoverView` &
`AddEditBookmarkDialogView`
3. Enhance `BookmarkManager` & `BookmarkStore` to update Folder title
and location in one save.
alessandroboron added a commit that referenced this pull request Mar 14, 2024
Task/Issue URL:
https://app.asana.com/0/72649045549333/1206590790808721/f

**Description**:
1. Add logic and test for `AddEditBookmarkFolderViewModel`.
2. Make a common view to re-use by `AddBookmarkPopoverView` &
`AddEditBookmarkDialogView`
3. Enhance `BookmarkManager` & `BookmarkStore` to update Folder title
and location in one save.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants